﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GnufBase.h"
#include "GnufBaseUtils.h"

namespace gnuf {

    class Info;
    
    class GNUF_BASE_EXPORT Separator : public gcmp::WeakReferenceable
    {
    public:
        Separator(const Color &, int, bool h = false, int l = -1);        
        Color color; int thickness, length;
        bool horizontal;
    };

    enum class EScrollType : std::uint8_t
    {
        eButton,
        eBar
    };

    class GNUF_BASE_EXPORT ToolbarAppearanceSetting : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(ToolbarAppearanceSetting)
    public:
        ToolbarAppearanceSetting();

    /*                                 __ Separator
                                      /
        +----------------------------/--------------+
        |           Top Spacing     /               |
        |       +------------------o--------+       |
        |Left   |       |X|       |X|       |  Right|
        |       | Block |X| Block |X| Block |       |
        |Spacing|       |X|       |X|       |Spacing|
        |       +---------------------------+       |
        |                    Bottom Spacing         |
        +-------------------------------------------+
    */
        int leftSpacing, topSpacing, rightSpacing, bottomSpacing, contentSpacing;
        gcmp::OwnerPtr< Separator > blockSeparator;
    /*
                            Width
                           >|   |<
                 ___________.___.
                |           |   | 
                |  I c o n  | ^ | Drop
           _ _ _|___________| v | Down
           v                |   | Button
        Spacing             |___|
           ^_ _
              [ C a p t i o n ]
    */
        int spacingBetweenIconAndCaptionInsideButton;
        int widthOfDropdownButton;
        EIconSize iconSize;
        gcmp::OwnerPtr< Color > background;
        int thicknessOfScrollButton;
        EScrollType type;
        int titleBarButtonHeight;
        int titleBarButtonWidthMargin;
        bool showAssisPanelHScroll;
        int titleBarFontSize;
        int leftMarginOfBreadscrumb;
        struct { bool left, top, right, bottom; } wantBorder;
        gcmp::OwnerPtr< Color > borderColor;

        int spacingBetweenBlockAndBlockCaption;
        bool alignCenter;
    };
    
    class GNUF_BASE_EXPORT ViewTabbarAppearanceSetting : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(ViewTabbarAppearanceSetting)
    public:
        ViewTabbarAppearanceSetting();
        
        EIconSize iconSize;
        gcmp::OwnerPtr< Color >
            tabIdleBackground,
            tabHoveredBackground,
            tabTextIdleColor,
            tabTextHoveredColor,
            tabTextUnworkableColor,
            showMoreButtonIdleBackground,
            showMoreButtonHoveredBackground,
            spliterColor;
        //the spacing of child content layout(such as tab of tabbar)
        int leftSpacing, topSpacing, rightSpacing, bottomSpacing;
        int spacingBetweenIconAndCaptionInsideTab;
        int spacingBetweenCloseIconAndOther;
        //the spacing from one tab to another
        int spacingBetweenTabAndTab;
    };

    class GNUF_BASE_EXPORT TextAppearanceSetting : public gcmp::WeakReferenceable
    {
    public:
        struct { int width = 0, height = 0; } minimumSize;
        int borderRadius = 0;
        bool expandWidthAndHeight = false;
        bool hasBorder = true;
        gcmp::OwnerPtr< Color >
            borderColor,
            borderFocusColor,
            editableBackgroundColor,
            readonlyBackgroundColor,
            readonlyTextColor,
            textColor,
            // disable 的优先级大于 readonly
            // disable 颜色会覆盖 readonly
            disableBackgroundColor,
            disableTextColor;
        int padding = -1;   // <0 表示为无效值
    };
    
    struct GNUF_BASE_EXPORT LabelAppearanceSetting final : public gcmp::WeakReferenceable
    {
        struct { int width = 0, height = 0; } minimumSize;
        bool expandWidthAndHeight = false;
        gcmp::OwnerPtr<Color>
            backgroundColor,
            disabledBackgroundColor,
            textColor,
            disabledTextColor;
    };

    class GNUF_BASE_EXPORT ListAppearanceSetting final : public gcmp::WeakReferenceable
    {
    public:
        int MinimumHeight = 24;
        int MinimumWidth = 50;
        int BorderRadius = 2;
        int BorderWidth = 1;
        gcmp::OwnerPtr<Color> BorderColor, BorderFocusColor, ListCtlBgColor, TextColor, ListDisabledColor, disabledBgColor;

        void setSizePolicy(ESizePolicy hor, ESizePolicy ver) { m_horizontalSizePolicy = hor; m_verticalSizePolicy = ver; }
        inline ESizePolicy horizontalSizePolicy() const { return m_horizontalSizePolicy; }

        void setVerticalSizePolicy(ESizePolicy  ePolicy) { m_verticalSizePolicy = ePolicy; }
        inline ESizePolicy verticalSizePolicy() const { return m_verticalSizePolicy; }

    private:
        ESizePolicy m_horizontalSizePolicy = ESizePolicy::Preferred, m_verticalSizePolicy = ESizePolicy::Fixed;
    };
    
    class GNUF_BASE_EXPORT WorkspaceTabBarApparanceSetting final : public gcmp::WeakReferenceable
    {
    public:
        WorkspaceTabBarApparanceSetting();
        ~WorkspaceTabBarApparanceSetting() {};
        gcmp::OwnerPtr< Color >
            tabBackgroundNormalColor,
            tabTextNormalColor,
            tabTextHoverColor,
            tabTextPressedColor,
            tabBackgroundPressedColor;
        int tabMinimumWidth;
        int tabMinimumHeight;
        int tabRegionAreaOffset;
        int tabBarMaxWidth;
        int spacingBetweenTabs;
        int textSpacing;
        int spacingBetweenLastTabAndNearBlock;
    };

    class GNUF_BASE_EXPORT DropdownMenuAppearanceSetting final : public gcmp::WeakReferenceable
    {
    public:
        DropdownMenuAppearanceSetting();
        ~DropdownMenuAppearanceSetting() {};

        gcmp::OwnerPtr< Color > dropdownMenuEntryClick,
            dropdownMenuEntryNormal,
            dropdownMenuEntryHover,
            dropdownMenuEntryPress,
            dropdownMenuEntrySelect,
            dropdownMenuIconHighlight,
            dropdownMenuIconBackground,
            textColor,
            separatorColor;

        int dropdownMenuEntryTopSapce;
        int dropdownMenuEntyrBottomSpace;
        int dropdownMenuEntryLeftSpace;
        int dropdownMenuEntryRightSpace;
        int dropdownMenuEntryIconSpace;
        int dropdownMenuEntryIconSize;

        int dropdownMenuWidth;
        int iconBackgroundSpace;
        int dropdownMenuHeight;
        int separatorHeight;
        int m_style;
    };

    class GNUF_BASE_EXPORT NameValuePairsAppearanceSetting : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(NameValuePairsAppearanceSetting)

    public:
        NameValuePairsAppearanceSetting();
        virtual ~NameValuePairsAppearanceSetting() {}

    public:
        enum class ArrowState : std::uint8_t
        {
            On,
            Off
        };

    public:
        int iconSize() const;
        void setIconSize(EIconSize val) { m_iconSize = val; }

        int spacing() const { return m_spacing; }
        void setSpacing(int val) { m_spacing = val; }

        int groupSpacing() const { return m_groupSpacing; }
        void setGroupSpacing(int val) { m_groupSpacing = val; }

        int titleSpacing() const { return m_titleSpacing; }
        void setTitleSpacing(int val) { m_titleSpacing = val; }

        int titleMargin() const { return m_titleMargin; }
        void setTitleMargin(int val) { m_titleMargin = val; }

        int minimumLabelWidth() const { return m_minimumLabelWidth; }
        void setMinimumLabelWidth(int val) { m_minimumLabelWidth = val; }
        int fontSize() const { return m_fontSize; }
        void setFontSize(int val) { m_fontSize = val; }

        int titleFontSize() const { return m_titleFontSize; }
        void setTitleFontSize(int val) { m_titleFontSize = val; }

        int rowMinimumHeight() const { return m_rowMinimumHeight; }
        void setRowMinimumHeight(int val) { m_rowMinimumHeight = val; }

        const gnuf::Color& backgroundColor() const { return m_backgroundColor; }
        void setBackgroundColor(const gnuf::Color& color) { m_backgroundColor = color; }

        const gnuf::Color& textColor() const { return m_textColor; }
        void setTextColor(const gnuf::Color& color) { m_textColor = color; }

        const gnuf::Color& arrowIconHoverColor() const { return m_arrowIconHoverColor; }
        void setArrowIconHoverColor(const gnuf::Color& color) { m_arrowIconHoverColor = color; }

        const std::wstring arrowIconPath(ArrowState state) const;
        void setArrowIconPath(const std::wstring& path) { m_arrowIconPath = path; }

        void setAutoStrench(bool is) { m_autoStrench = is; }
        bool needAutoStrench() const { return m_autoStrench; }

        int spacingBetweenControlsInBlock() const {
            return m_spacingBetweenControlsInBlock;
        }
        int valueColumnMinimumWidth() const {
            return m_valueColumnMinimumWidth;
        }
        const Size & fixedSizeOfButtonInBlock() const {
            return m_fixedSizeOfButtonInBlock;
        }
    private:
        const std::wstring iconPath(const std::wstring& path) const;

    private:
        // all of above size unit is pixel
        EIconSize m_iconSize;
        int m_minimumLabelWidth;
        int m_fontSize;
        int m_titleFontSize;
        int m_rowMinimumHeight;
        int m_spacing;
        int m_groupSpacing;
        int m_titleSpacing;
        int m_titleMargin;
        gnuf::Color m_backgroundColor;
        gnuf::Color m_textColor;
        gnuf::Color m_arrowIconHoverColor;
        std::wstring m_arrowIconPath;
        bool m_autoStrench;
        int m_spacingBetweenControlsInBlock;
        int m_valueColumnMinimumWidth;
        Size m_fixedSizeOfButtonInBlock;
    };

    class GNUF_BASE_EXPORT SearchBoxAppearanceSetting final
    {
        CANNOT_COPY_OR_ASSIGN(SearchBoxAppearanceSetting)
    public:
        SearchBoxAppearanceSetting();
        ~SearchBoxAppearanceSetting() {}

    public:
        inline EIconSize iconSize() const { return m_iconSize; }
        inline int iconPixelSize() const { return static_cast<int>(m_iconSize); }
        void setIconSize(EIconSize val) { m_iconSize = val; }

        inline EIconSize searchHandleSize() const { return m_searchHandleSize; }
        inline int searchHandlePixelSize() const { return static_cast<int>(m_searchHandleSize); }
        void setSearchHandleSize(EIconSize val) { m_searchHandleSize = val; }

        inline unsigned int fontSize() const { return m_fontSize; }
        void setFontSize(unsigned int val) { m_fontSize = val; }

        inline int height() const { return m_height; }
        void setHeight(int val) { m_height = val; }

        inline int width() const { return m_width; }
        void setWidth(int val) { m_width = val; }

        inline const Color* borderColor() const { return m_borderColor.get(); }
        void setBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setBorderColor(const Color& color) { m_borderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* backgroundColor() const { return m_bgColor.get(); }
        void setBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setBackgroundColor(const Color& color) { m_bgColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textColor() const { return m_bgColor.get(); }
        void setTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextColor(const Color& color) { m_textColor = NEW_AS_OWNER_PTR(Color, color); }
    private:
        // all of above size unit is pixel
        EIconSize m_iconSize;
        EIconSize m_searchHandleSize;
        unsigned int m_fontSize;
        int m_height;
        int m_width;
        gcmp::OwnerPtr<Color> m_borderColor;
        gcmp::OwnerPtr<Color> m_bgColor;
        gcmp::OwnerPtr<Color> m_textColor;
    };

    class GNUF_BASE_EXPORT LineEditComboBoxAppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(LineEditComboBoxAppearanceSetting)
    public:
        LineEditComboBoxAppearanceSetting();
        ~LineEditComboBoxAppearanceSetting() {}
    public:
        inline EIconSize iconSize() const { return m_iconSize; }
        inline int iconPixelSize() const { return static_cast<int>(m_iconSize); }
        void setIconSize(EIconSize val) { m_iconSize = val; }

        inline unsigned int fontSize() const { return m_fontSize; }
        void setFontSize(unsigned int val) { m_fontSize = val; }

        inline int height() const { return m_height; }
        void setHeight(int val) { m_height = val; }

        inline int width() const { return m_width; }
        void setWidth(int val) { m_width = val; }

        inline const Color* borderColor() const { return m_borderColor.get(); }
        void setBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setBorderColor(const Color& color) { m_borderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* errorBorderColor() const { return m_errorBorderColor.get(); }
        void setErrorBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setErrorBorderColor(const Color& color) { m_errorBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disableBorderColor() const { return m_disabledBorderColor.get(); }
        void setDisableBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setDisableBorderColor(const Color& color) { m_disabledBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* hoveredBorderColor() const { return m_hoveredBorderColor.get(); }
        void setHoveredBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setHoveredBorderColor(const Color& color) { m_hoveredBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* pressedBorderColor() const { return m_pressedBorderColor.get(); }
        void setPressedBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setPressedBorderColor(const Color& color) { m_pressedBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* backgroundColor() const { return m_bgColor.get(); }
        void setBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setBackgroundColor(const Color& color) { m_bgColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disableBackgroundColor() const { return m_disableBgColor.get(); }
        void setDisableBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setDisableBackgroundColor(const Color& color) { m_disableBgColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textColor() const { return m_textColor.get(); }
        void setTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextColor(const Color& color) { m_textColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disableTextColor() const { return m_disableTextColor.get(); }
        void setDisableTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setDisableTextColor(const Color& color) { m_disableTextColor = NEW_AS_OWNER_PTR(Color, color); }

    private:
        EIconSize m_iconSize;
        unsigned int m_fontSize;
        int m_height;
        int m_width;
        gcmp::OwnerPtr<Color> m_borderColor;
        gcmp::OwnerPtr<Color> m_errorBorderColor;
        gcmp::OwnerPtr<Color> m_disabledBorderColor;
        gcmp::OwnerPtr<Color> m_bgColor;
        gcmp::OwnerPtr<Color> m_disableBgColor;
        gcmp::OwnerPtr<Color> m_textColor;
        gcmp::OwnerPtr<Color> m_disableTextColor;
        //hover 
        gcmp::OwnerPtr<Color> m_hoveredBorderColor;

        //pressed
        gcmp::OwnerPtr<Color> m_pressedBorderColor;
    };

    class GNUF_BASE_EXPORT BadgeAppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(BadgeAppearanceSetting)
    public:
        BadgeAppearanceSetting();
        virtual ~BadgeAppearanceSetting() {}
    public:
        void setBadgeType(EBadgeType type) { m_badgeType = type; }
        inline EBadgeType badgeType() const { return m_badgeType; }

        inline const Color* badgeColor() const { return m_badgeColor.get(); }
        void setBadgeColor(const Color& badgeColor) { m_badgeColor = NEW_AS_OWNER_PTR(Color, badgeColor); }
        void setBadgeColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);

        void setPositionOfBadge(EPlacement position) { m_positionOfBadge = position; }
        inline EPlacement positionOfBadge() const { return m_positionOfBadge; }

        void setBadgeRadius(int radius) { m_badgeRadius = radius; }
        inline int badgeRadius() const { return m_badgeRadius; }

        void setBadgeLineHeight(int height) { m_badgeHeight = height; }
        inline int badgeLineHeight() const { return m_badgeHeight; }

        inline Padding badgePadding() const { return m_badgePadding; }
        inline void setBadgePadding(const Padding& val) { m_badgePadding = val; }

        inline int badgeFontSize() const { return m_badgeFontSize; }
        inline void setBadgeFontSize(int fontSize) { m_badgeFontSize = fontSize; }
    private:
        int m_badgeRadius;
        int m_badgeHeight;
        int m_badgeFontSize;
        Padding m_badgePadding;
        gcmp::OwnerPtr<Color> m_badgeColor;
        EBadgeType m_badgeType;
        EPlacement m_positionOfBadge;
    };

    class GNUF_BASE_EXPORT GridAppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(GridAppearanceSetting)
    public:
        GridAppearanceSetting();
        ~GridAppearanceSetting() {}

        inline int verticalSpacing() const { return m_vSpacing; }
        inline void setVerticalSpacing(int val) { m_vSpacing = val; }

        inline int horizontalSpacing() const { return m_hSpacing; }
        inline void setHorizontalSpacing(int val) { m_hSpacing = val; }

    private:
        int m_vSpacing;
        int m_hSpacing;
    };

    class GNUF_BASE_EXPORT ButtonAppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(ButtonAppearanceSetting)
    public:
        ButtonAppearanceSetting();
        ~ButtonAppearanceSetting() {}

    public:
        inline EIconSize iconSize() const { return m_iconSize; }
        int iconWidthPixel() const;
        int iconHeightPixel() const;
        void setIconSize(EIconSize val) { m_iconSize = val; }
        void setCustomIconHeight(int val) { m_customIconHeight = val; }
        void setCustomIconWidth(int val) { m_customIconWidth = val; }

        inline EIconSize arrowSize() const { return m_arrowSize; }
        inline int arrowPixelSize() const { return static_cast<int>(m_arrowSize); }
        void setArrowSize(EIconSize val) { m_arrowSize = val; }

        inline EIconSize checkBoxSize() const { return m_checkBoxSize; }
        inline int checkBoxPixelSize() const { return static_cast<int>(m_checkBoxSize); }
        void setCheckBoxSize(EIconSize val) { m_checkBoxSize = val; }

        void setCustomizeArrowInfo(const Info&);
        const Info* customizeArrowInfo() const { return m_customizeArrowInfo.get(); }
        bool hasCustomizeArrow() const { return m_customizeArrowInfo.get() != nullptr; }

        inline unsigned int fontSize() const { return m_fontSize; }
        void setFontSize(unsigned int val) { m_fontSize = val; }

        inline int height() const { return m_height; }
        void setHeight(int val) { m_height = val; }

        inline int width() const { return m_width; }
        void setWidth(int val) { m_width = val; }

        inline int minWidth() const { return m_minWidth; }
        void setMinWidth(int val) { m_minWidth = val; }

        inline int minHeight() const { return m_minHeight; }
        void setMinHeight(int val) { m_minHeight = val; }

        inline int maxWidth() const { return m_maxWidth; }
        inline void setMaxWidth(int val) { m_maxWidth = val; }

        inline int maxTextWidth() const { return m_maxTextWidth; }
        inline void setMaxTextWidth(int val) { m_maxTextWidth = val; }

        inline int maxHeight() const { return m_maxHeight; }
        inline void setMaxHeight(int val) { m_maxHeight = val; }

        inline int spacing() const { return m_spacing; }
        inline void setSpacing(int val) { m_spacing = val; }

        inline Padding padding() const { return m_padding; }
        inline void setPadding(const Padding& val) { m_padding = val; }

        inline int borderRadius() const { return m_borderRadius; }
        void setBorderRadius(int val) { m_borderRadius = val; }

        inline int borderWidth() const { return m_borderWidth; }
        void setBorderWidth(int val) { m_borderWidth = val; }

        inline const Color* backgroundColor() const { return m_bgColor.get(); }
        void setBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setBackgroundColor(const Color& color) { m_bgColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* hoverColor() const { return m_hoverColor.get(); }
        void setHoverColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setHoverColor(const Color& color) { m_hoverColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* pressedColor() const { return m_pressedColor.get(); }
        inline void setPressedColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setPressedColor(const Color& color) { m_pressedColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* selectedColor() const { return m_selectedColor.get(); }
        inline void setSelectedColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setSelectedColor(const Color& color) { m_selectedColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disabledColor() const { return m_disabledColor.get(); }
        inline void setDisabledColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setDisabledColor(const Color& color) { m_disabledColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* borderColor() const { return m_borderColor.get(); }
        void setBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setBorderColor(const Color& color) { m_borderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* hoveredBorderColor() const { return m_hoveredBorderColor.get(); }
        void setHoveredBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setHoveredBorderColor(const Color& color) { m_hoveredBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* pressedBorderColor() const { return m_pressedBorderColor.get(); }
        void setPressedBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setPressedBorderColor(const Color& color) { m_pressedBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* selectedBorderColor() const { return m_selectedBorderColor.get(); }
        void setSelectedBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setSelectedBorderColor(const Color& color) { m_selectedBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disabledBorderColor() const { return m_disabledBorderColor.get(); }
        void setDisabledBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setDisabledBorderColor(const Color& color) { m_disabledBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textColor() const { return m_textColor.get(); }
        void setTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setTextColor(const Color& color) { m_textColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* hoveredTextColor() const { return m_hoveredTextColor.get(); }
        void setHoveredTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setHoveredTextColor(const Color& color) { m_hoveredTextColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* pressedTextColor() const { return m_pressedTextColor.get(); }
        void setPressedTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setPressedTextColor(const Color& color) { m_pressedTextColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* selectedTextColor() const { return m_selectedTextColor.get(); }
        void setSelectedTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setSelectedTextColor(const Color& color) { m_selectedTextColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disabledTextColor() const { return m_disabledTextColor.get(); }
        void setDisabledTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setDisabledTextColor(const Color& color) { m_disabledTextColor = NEW_AS_OWNER_PTR(Color, color); }

        inline int disabledAlphaValue() const { return m_disabledAlphaValue; }
        void setDisabledAlphaValue(int val) { m_disabledAlphaValue = val; }

        inline bool captionVisible() const { return m_bShowCaption; }
        void setCaptionVisible(bool val) { m_bShowCaption = val; }

        void setSizeConstraint(ELayoutSizeConstraint val) { m_sizeConstraint = val; }
        inline ELayoutSizeConstraint sizeConstraint() const { return m_sizeConstraint; }

        void setSizePolicy(ESizePolicy hor, ESizePolicy ver) { m_horizontalSizePolicy = hor; m_verticalSizePolicy = ver; }
        inline ESizePolicy horizontalSizePolicy() const { return m_horizontalSizePolicy; }

        void setVerticalSizePolicy(ESizePolicy  ePolicy) { m_verticalSizePolicy = ePolicy; }
        inline ESizePolicy verticalSizePolicy() const { return m_verticalSizePolicy; }

        void setTextAlignment(int align) { m_textAliginment = align; }
        inline int textAliginment() const { return m_textAliginment; }

        void setButtonTextLabelWidth(int width) { m_buttonTextLabelWidth = width; }
        inline int buttonTextLabelWidth() const { return m_buttonTextLabelWidth; }

        void setButtonTextLabelHeight(int height) { m_buttonTextLabelHeight = height; }
        inline int buttonTextLabelHeight() const { return m_buttonTextLabelHeight; }

        void setButtonTextLabelPadding(const Padding& val) { m_buttonTextLabelPadding = val; }
        inline Padding buttonTextLabelPadding() const { return m_buttonTextLabelPadding; }

        void setButtonTextWidth(int width) { m_buttonTextWidth = width; }
        inline int buttonTextWidth()const { return m_buttonTextWidth; }

        void setButtonTextLabelAlignment(int alignment) { m_buttonTextLabelAlignment = alignment; }
        inline int buttonTextLabelAlignment() const { return m_buttonTextLabelAlignment; }

        inline const BadgeAppearanceSetting* badgeAppearanceSetting() const {
            return m_badgeAppearanceSetting.get();
        }

        inline BadgeAppearanceSetting* badgeAppearanceSetting() {
            if (m_badgeAppearanceSetting == nullptr) {
                m_badgeAppearanceSetting = NEW_AS_OWNER_PTR(BadgeAppearanceSetting);
            }
            return m_badgeAppearanceSetting.get();
        }
    private:
        // base style
        EIconSize m_iconSize;
        EIconSize m_arrowSize;
        EIconSize m_checkBoxSize;
        int m_customIconHeight;
        int m_customIconWidth;
        unsigned int m_fontSize;
        gcmp::OwnerPtr<Info> m_customizeArrowInfo;

        // common style
        int m_width;
        int m_height;
        int m_minWidth;
        int m_minHeight;
        int m_maxWidth;
        int m_maxHeight;
        int m_spacing = 4;
        Padding m_padding;
        int m_borderRadius;
        int m_borderWidth;
        ELayoutSizeConstraint m_sizeConstraint;
        ESizePolicy m_verticalSizePolicy, m_horizontalSizePolicy;
        
        // base text style
        int m_textAliginment;
        int m_maxTextWidth;

        // style for pushbutton textLabel
        int m_buttonTextLabelWidth;
        int m_buttonTextLabelHeight;
        Padding m_buttonTextLabelPadding;
        int m_buttonTextLabelAlignment;
        int m_buttonTextWidth;

        // base color style
        gcmp::OwnerPtr<Color> m_bgColor;
        gcmp::OwnerPtr<Color> m_hoverColor;
        gcmp::OwnerPtr<Color> m_pressedColor;
        gcmp::OwnerPtr<Color> m_selectedColor; // actived/selected
        gcmp::OwnerPtr<Color> m_disabledColor;

        // border color style
        gcmp::OwnerPtr<Color> m_borderColor;
        gcmp::OwnerPtr<Color> m_hoveredBorderColor;
        gcmp::OwnerPtr<Color> m_pressedBorderColor;
        gcmp::OwnerPtr<Color> m_selectedBorderColor; // actived/selected
        gcmp::OwnerPtr<Color> m_disabledBorderColor;

        // text color style
        gcmp::OwnerPtr<Color> m_textColor;
        gcmp::OwnerPtr<Color> m_hoveredTextColor;
        gcmp::OwnerPtr<Color> m_pressedTextColor;
        gcmp::OwnerPtr<Color> m_selectedTextColor;
        gcmp::OwnerPtr<Color> m_disabledTextColor;

        // icon style (option)
        int m_disabledAlphaValue;

        // caption visible option
        bool m_bShowCaption;
        //badgeAppearanceSetting
        gcmp::OwnerPtr<BadgeAppearanceSetting> m_badgeAppearanceSetting;
    };

    class GNUF_BASE_EXPORT TagAppearanceSetting : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(TagAppearanceSetting)
    public:
        TagAppearanceSetting();
        ~TagAppearanceSetting() {}
        inline int boarderWidth() const { return m_boarderWidth; }
        inline void setBoarderWidth(int width) { m_boarderWidth = width; }

        inline int height() const { return m_height; }
        inline void setHeight(int height) { m_height = height; }

        inline int fontSize() const { return m_fontSize; }
        inline void setFontSize(int size) { m_fontSize = size; }

        inline int closeButtonWidth() const { return m_closeButtonWidth; }
        inline void setCloseButtonWidth(int width) { m_closeButtonWidth = width; }

        inline int closeButtonHeight() const { return m_closeButtonHeight; }
        inline void setCloseButtonHeight(int height) { m_closeButtonHeight = height; }

        inline const Color* boarderColor() const { return m_boarderColor.get(); }
        void setBoarderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setBoarderColor(const Color& color) { m_boarderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* normalBackColor() const { return m_normalBackColor.get(); }
        void setNormalBackColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setNormalBackColor(const Color& color) { m_normalBackColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* hoveredBackColor() const { return m_hoveredBackColor.get(); }
        void setHoveredBackColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setHoveredBackColor(const Color& color) { m_hoveredBackColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* pressedBackColor() const { return m_pressedBackColor.get(); }
        void setPressedBackColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setPressedBackColor(const Color& color) { m_pressedBackColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textColor() const { return m_textColor.get(); }
        void setTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setTextColor(const Color& color) { m_textColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textHoveredColor() const { return m_textHoveredColor.get(); }
        void setTextHoveredColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setTextHoveredColor(const Color& color) { m_textHoveredColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textPressedColor() const { return m_textPressedColor.get(); }
        void setTextPressedColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setTextPressedColor(const Color& color) { m_textPressedColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* closeButtonColor() const { return m_closeButtonColor.get(); }
        void setCloseButtonColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setCloseButtonColor(const Color& color) { m_closeButtonColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* closeButtonHoveredColor() const { return m_closeButtonHoveredColor.get(); }
        void setCloseButtonHoveredColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setCloseButtonHoveredColor(const Color& color) { m_closeButtonHoveredColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* closeButtonPressedColor() const { return m_closeButtonPressedColor.get(); }
        void setCloseButtonPressedColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setCloseButtonPressedColor(const Color& color) { m_closeButtonPressedColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const std::wstring closeIcon() const { return m_closeIcon; }
        void stCloseIcon(const std::wstring& closeIconPath) { m_closeIcon = closeIconPath; }

    private:
        int m_boarderWidth;
        int m_height;
        int m_fontSize;
        int m_closeButtonWidth;
        int m_closeButtonHeight;

        gcmp::OwnerPtr<gnuf::Color> m_boarderColor;
        gcmp::OwnerPtr<gnuf::Color> m_normalBackColor;
        gcmp::OwnerPtr<gnuf::Color> m_hoveredBackColor;
        gcmp::OwnerPtr<gnuf::Color> m_pressedBackColor;

        gcmp::OwnerPtr<gnuf::Color> m_textColor;
        gcmp::OwnerPtr<gnuf::Color> m_textHoveredColor;
        gcmp::OwnerPtr<gnuf::Color> m_textPressedColor;

        gcmp::OwnerPtr<gnuf::Color> m_closeButtonColor;
        gcmp::OwnerPtr<gnuf::Color> m_closeButtonHoveredColor;
        gcmp::OwnerPtr<gnuf::Color> m_closeButtonPressedColor;
        std::wstring m_closeIcon;

    };
    
    class GNUF_BASE_EXPORT TagPadAppearanceSetting : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(TagPadAppearanceSetting)
    public:
        TagPadAppearanceSetting();
        ~TagPadAppearanceSetting(){}
    public:
        inline int spacingBetweenTags() const { return m_spacingBetweenTags; }
        inline void setSpacingBetweenTags(int spacing) { m_spacingBetweenTags = spacing; }

        inline int defaultHeight() const { return m_defaultHeight; }
        inline void setDefaultHeight(int height) { m_defaultHeight = height; }

        inline int minimumWidth() const { return m_minimumWidth; }
        inline void setMinimumWidth(int width) { m_minimumWidth = width; }

        inline EIconSize arrowSize() const { return m_arrowSize; }
        inline int arrowIconPixel() const { return static_cast<int>(m_arrowSize); }
        inline void setArrowIconPixel(EIconSize val) { m_arrowSize = val; }

        inline Padding padding() const { return m_padding; }
        inline void setPadding(const Padding& val) { m_padding = val; }

        inline const Color* backgroundColor() const { return m_backgroundColor.get(); }
        void setBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setBackgroundColor(const Color& color) { m_backgroundColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disableBackgroundColor() const { return m_disableBackgroundColor.get(); }
        void setDisableBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setDisableBackgroundColor(const Color& color) { m_disableBackgroundColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textColor() const { return m_textColor.get(); }
        void setTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setTextColor(const Color& color) { m_textColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* disableTextColor() const { return m_disableTextColor.get(); }
        void setDisableTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setDisableTextColor(const Color& color) { m_disableTextColor = NEW_AS_OWNER_PTR(Color, color); }

        const std::wstring arrowIcon() const { return m_arrowIcon; }

        void setArrowIcon(const std::wstring& icon) { m_arrowIcon = icon; }

    private:
        gcmp::OwnerPtr<gnuf::Color> m_backgroundColor;
        gcmp::OwnerPtr<gnuf::Color> m_disableBackgroundColor;
        gcmp::OwnerPtr<gnuf::Color> m_textColor;
        gcmp::OwnerPtr<gnuf::Color> m_disableTextColor;

        int m_spacingBetweenTags;
        Padding m_padding;
        std::wstring m_arrowIcon;
        int m_defaultHeight;
        int m_minimumWidth;
        EIconSize m_arrowSize;

    };
    
    class GNUF_BASE_EXPORT TreeViewAppearanceSetting : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(TreeViewAppearanceSetting)

    public:
        TreeViewAppearanceSetting();
        virtual ~TreeViewAppearanceSetting() {}

    public:
        enum class ArrowState : std::uint8_t
        {
            On,
            Off
        };

    public:
        inline EIconSize iconSize() const { return m_iconSize; }
        inline int iconPixelSize() const { return static_cast<int>(m_iconSize); }
        void setIconSize(EIconSize val) { m_iconSize = val; }

        inline EIconSize leafIconSize() const { return m_leafIconSize; }
        inline int leafIconPixelSize() const { return static_cast<int>(m_leafIconSize); }
        void setLeafIconSize(EIconSize val) { m_leafIconSize = val; }

        inline int indentation()  const { return m_indentation; }
        void setIndentation(int val) { m_indentation = val; }

        inline int minimumViewWidth() const { return m_minimumViewWidth; }
        void setMinimumViewWidth(int val) { m_minimumViewWidth = val; }

        inline int minimumViewHeigth() const { return m_minimumViewHeight; }
        void setMinimumViewHeight(int val) { m_minimumViewHeight = val; }

        inline int fontSize() const { return m_fontSize; }
        void setFontSize(int val) { m_fontSize = val; }

        inline int rowHeight() const { return m_rowHeight; }
        void setRowHeight(int val) { m_rowHeight = val; }

        inline int leafRowHeight() const { return m_leafRowHeight; }
        void setLeafRowHeight(int val) { m_leafRowHeight = val; }

        inline const gnuf::Color& backgroundColor() const { return m_backgroundColor; }
        void setBackgroundColor(const gnuf::Color& color) { m_backgroundColor = color; }

        inline const gnuf::Color& textColor() const { return m_textColor; }
        void setTextColor(const gnuf::Color& color) { m_textColor = color; }

        inline const gnuf::Color& outlineColor() const { return m_outlineColor; }
        void setOutlineColor(const gnuf::Color& color) { m_outlineColor = color; }

        inline const gnuf::Color& hoverColor() const { return m_hoverColor; }
        void setHoverColor(const gnuf::Color& color) { m_hoverColor = color; }

        inline const gnuf::Color& selectedColor() const { return m_selectedColor; }
        void setSelectedColor(const gnuf::Color& color) { m_selectedColor = color; }

        inline const gnuf::Color& leafHoverColor() const { return m_leafHoverColor; }
        void setLeafHoverColor(const gnuf::Color& color) { m_leafHoverColor = color; }

        inline const gnuf::Color& leafSelectedColor() const { return m_leafSelectedColor; }
        void setLeafSelectedColor(const gnuf::Color& color) { m_leafSelectedColor = color; }

        inline const gnuf::Color& activedColor() const { return m_activedColor; }
        void setActivedColor(const gnuf::Color& color) { m_activedColor = color; }

        inline const gnuf::Color& leafColor() const { return m_leafColor; }
        void setLeafColor(const gnuf::Color& color) { m_leafColor = color; }

        inline const gnuf::Color& nodeColor() const { return m_nodeColor; }
        void setNodeColor(const gnuf::Color& color) { m_nodeColor = color; }

        inline const gnuf::Color& borderColor() const { return m_borderColor; }
        void setBorderColor(const gnuf::Color& color) { m_borderColor = color; }

        const std::wstring arrowIconPath(ArrowState state) const;
        void setArrowIconPath(const std::wstring& path) { m_arrowIconPath = path; }

        bool hasTopBorder() const { return m_hasTopBorder; }
        bool hasLeftBorder() const { return m_hasLeftBorder; }
        bool hasBottomBorder() const { return m_hasBottomBorder; }
        bool hasRightBorder() const { return m_hasRightBorder; }

        void setHasTopBorder(bool val) { m_hasTopBorder = val; }
        void setHasLeftBorder(bool val) { m_hasLeftBorder = val; }
        void setHasBottomBorder(bool val) { m_hasBottomBorder = val; }
        void setHasRightBorder(bool val) { m_hasRightBorder = val; }

        inline const ButtonAppearanceSetting* buttonAppearanceSetting() const {
            return m_buttonAppearanceSetting.get();
        }

        inline ButtonAppearanceSetting* buttonAppearanceSetting() {
            if (m_buttonAppearanceSetting == nullptr) {
                m_buttonAppearanceSetting = NEW_AS_OWNER_PTR(ButtonAppearanceSetting);
            }
            return m_buttonAppearanceSetting.get();
        }

    private:
        const std::wstring iconPath(const std::wstring& path) const;

    private:
        // all of above size unit is pixel
        EIconSize m_iconSize;
        EIconSize m_leafIconSize;
        int m_indentation;
        int m_minimumViewWidth;
        int m_minimumViewHeight;
        int m_fontSize;
        int m_rowHeight;
        int m_leafRowHeight;
        gnuf::Color m_backgroundColor;
        gnuf::Color m_textColor;
        gnuf::Color m_outlineColor;
        gnuf::Color m_hoverColor;
        gnuf::Color m_selectedColor;
        gnuf::Color m_leafHoverColor;
        gnuf::Color m_leafSelectedColor;
        gnuf::Color m_activedColor;
        gnuf::Color m_disabledColor;
        gnuf::Color m_nodeColor;
        gnuf::Color m_leafColor;
        gnuf::Color m_borderColor;
        std::wstring m_arrowIconPath;
        bool m_hasTopBorder, m_hasLeftBorder, m_hasBottomBorder, m_hasRightBorder;
        gcmp::OwnerPtr<ButtonAppearanceSetting> m_buttonAppearanceSetting;
    };

    class GNUF_BASE_EXPORT DropDownBoardAppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(DropDownBoardAppearanceSetting)
    public:
        DropDownBoardAppearanceSetting();
        ~DropDownBoardAppearanceSetting() {}

    public:
        inline int height() const { return m_height; }
        void setHeight(int val) { m_height = val; }

        inline int width() const { return m_width; }
        void setWidth(int val) { m_width = val; }

        inline int maxWidth() const { return m_maxWidth; }
        inline void setMaxWidth(int val) { m_maxWidth = val; }

        inline int maxHeight() const { return m_maxHeight; }
        inline void setMaxHeight(int val) { m_maxHeight = val; }

        inline int minimumHeight() const { return m_minimumHeight; }
        inline void setMinimumHeight(int val) { m_minimumHeight = val; }

        inline int spacing() const { return m_spacing; }
        inline void setSpacing(int val) { m_spacing = val; }

        inline Padding padding() const { return m_padding; }
        inline void setPadding(const Padding& val) { m_padding = val; }

        inline const Color* backgroundColor() const { return m_bgColor.get(); }
        void setBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setBackgroundColor(const Color& color) { m_bgColor = NEW_AS_OWNER_PTR(Color, color);}

        inline const Color* borderColor() const { return m_borderColor.get(); }
        void setBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        inline void setBorderColor(const Color& color) { m_borderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const ButtonAppearanceSetting* menuItemAppearanceSetting() const {
            return m_menuItemAppearanceSetting.get();
        }

        inline ButtonAppearanceSetting* menuItemAppearanceSetting() {
            if (m_menuItemAppearanceSetting == nullptr) {
                m_menuItemAppearanceSetting = NEW_AS_OWNER_PTR(ButtonAppearanceSetting);
            }
            return m_menuItemAppearanceSetting.get();
        }

    private:
        Padding m_padding;
        int m_spacing;
        int m_width, m_maxWidth;
        int m_height, m_maxHeight, m_minimumHeight;
        gcmp::OwnerPtr< Color > m_bgColor;
        gcmp::OwnerPtr< Color > m_borderColor;
        gcmp::OwnerPtr<ButtonAppearanceSetting> m_menuItemAppearanceSetting;
    };

    class GNUF_BASE_EXPORT FamilyTypesAppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(FamilyTypesAppearanceSetting)
    public:
        FamilyTypesAppearanceSetting();
        ~FamilyTypesAppearanceSetting() {}

        inline int boardHeight() const { return m_boardHeight; }
        void setBoardHeight(int val) { m_boardHeight = val; }

        inline int boardWidth() const { return m_boardWidth; }
        void setBoardWidth(int val) { m_boardWidth = val; }

        inline int spacing() const { return m_spacing; }
        void setSpacing(int val) { m_spacing = val; }

        inline ButtonAppearanceSetting* familyTypeButtonAppearanceSetting() {
            if (m_familyTypeButtonAppearanceSetting == nullptr) {
                m_familyTypeButtonAppearanceSetting = NEW_AS_OWNER_PTR(ButtonAppearanceSetting);
            }
            return m_familyTypeButtonAppearanceSetting.get();
        }

        inline ButtonAppearanceSetting* addFamilyTypeButtonAppearanceSetting() {
            if (m_addFamilyTypeButtonAppearanceSetting == nullptr) {
                m_addFamilyTypeButtonAppearanceSetting = NEW_AS_OWNER_PTR(ButtonAppearanceSetting);
            }
            return m_addFamilyTypeButtonAppearanceSetting.get();
        }

        inline ButtonAppearanceSetting* editFamilyTypeButtonAppearanceSetting() {
            if (m_editFamilyTypeButtonAppearanceSetting == nullptr) {
                m_editFamilyTypeButtonAppearanceSetting = NEW_AS_OWNER_PTR(ButtonAppearanceSetting);
            }
            return m_editFamilyTypeButtonAppearanceSetting.get();
        }

        inline const ButtonAppearanceSetting* familyTypeButtonAppearanceSetting() const {
            return m_familyTypeButtonAppearanceSetting.get();
        }

        inline const ButtonAppearanceSetting* addFamilyTypeButtonAppearanceSetting() const {
            return m_addFamilyTypeButtonAppearanceSetting.get();
        }

        inline const ButtonAppearanceSetting* editFamilyTypeButtonAppearanceSetting() const {
            return m_editFamilyTypeButtonAppearanceSetting.get();
        }

    private:
        int m_boardHeight;
        int m_boardWidth;
        int m_spacing;

        gcmp::OwnerPtr<ButtonAppearanceSetting> m_familyTypeButtonAppearanceSetting;
        gcmp::OwnerPtr<ButtonAppearanceSetting> m_addFamilyTypeButtonAppearanceSetting;
        gcmp::OwnerPtr<ButtonAppearanceSetting> m_editFamilyTypeButtonAppearanceSetting;
    };

    class GNUF_BASE_EXPORT TableAppearanceSetting : public gcmp::WeakReferenceable
    {
    public:
        gnuf::Color gridColor;
        gnuf::Color textColor;
        gnuf::Color topTableHeaderNodeBackgroundColor;
        gnuf::Color backgroundColor;
        gnuf::Color selectedBackgroundColor;
        gnuf::Color hoveredBackgroundColor;
        gnuf::Color majorHeaderBackgroundColor;
        gnuf::Color minorHeaderBackgroundColor;
        int indent;     // 行缩进
        int spacing = 0;    // row header 元素的间距 

        TableAppearanceSetting();
        ~TableAppearanceSetting() {};
    };

    class GNUF_BASE_EXPORT ScrollbarAppearanceSetting : public gcmp::WeakReferenceable
    {
    public:
        ScrollbarAppearanceSetting();
        ~ScrollbarAppearanceSetting() {};

    public:
        gnuf::Color scrollbarBgColor() const { return m_scrollbarBgColor; }
        gnuf::Color scrollbarHandleColor() const { return m_scrollbarHandleColor; }
        int scrollbarHandleHeight() const { return m_scrollbarHandleHeight; }
        int scrollbarWidth() const { return m_scrollbarWidth; }
        int scrollbarHandleWidth() const { return m_scrollbarHandleWidth; }
        int scrollbarHeight() const { return m_scrollbarHeight; }

    public:
        gnuf::Color m_scrollbarBgColor;
        gnuf::Color m_scrollbarHandleColor;
        int m_scrollbarHandleHeight;
        int m_scrollbarWidth;
        int m_scrollbarHandleWidth;
        int m_scrollbarHeight;
    };

    class GNUF_BASE_EXPORT ProgressBarAppearanceSetting : public gcmp::WeakReferenceable
    {
    public:
        ProgressBarAppearanceSetting();
        ~ProgressBarAppearanceSetting() {};
    public:
        int progressbarHeight() const { return m_progressbarHeight; }
        int progressbarWidth() const { return m_progressbarWidth; }
        int valueLabelWidth()  const { return m_valueLabelWidth; }
        void setprogressbarHeight(int height) { m_progressbarHeight = height; }
        void setprogressbarWidth(int width) { m_progressbarWidth = width; }
        void setValueLabelWidth(int width) { m_valueLabelWidth = width; }
    private:
        int m_progressbarHeight;
        int m_progressbarWidth;
        int m_valueLabelWidth;
    };

    class GNUF_BASE_EXPORT ColorControlAppearanceSetting final : public gcmp::WeakReferenceable
    {
    public:
        ColorControlAppearanceSetting();
        ~ColorControlAppearanceSetting() {};

    public:
        inline EIconSize iconSize() const { return m_iconSize; }
        inline int iconPixelSize() const { return static_cast<int>(m_iconSize); }
        void setIconSize(EIconSize val) { m_iconSize = val; }

        inline unsigned int fontSize() const { return m_fontSize; }
        void setFontSize(unsigned int val) { m_fontSize = val; }

        inline int height() const { return m_height; }
        void setHeight(int val) { m_height = val; }

        inline int width() const { return m_width; }
        void setWidth(int val) { m_width = val; }

        inline int borderRadius() const { return m_borderRadius; }
        void setBorderRadius(int val) { m_borderRadius = val; }

        inline const Color* backgroundColor() const { return m_bgColor.get(); }
        void setBackgroundColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setBackgroundColor(const Color& color) { m_bgColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* hoverColor() const { return m_hoverColor.get(); }
        void setHoverColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setHoverColor(const Color& color) { m_hoverColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* borderColor() const { return m_borderColor.get(); }
        void setBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setBorderColor(const Color& color) { m_borderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textColor() const { return m_textColor.get(); }
        void setTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextColor(const Color& color) { m_textColor = NEW_AS_OWNER_PTR(Color, color); }

    private:
        EIconSize m_iconSize;
        unsigned int m_fontSize;
        int m_width;
        int m_height;
        int m_borderRadius;
        gcmp::OwnerPtr<Color> m_bgColor;
        gcmp::OwnerPtr<Color> m_hoverColor;
        gcmp::OwnerPtr<Color> m_borderColor;
        gcmp::OwnerPtr<Color> m_textColor;
    };

    class GNUF_BASE_EXPORT SliderAppearanceSetting final : public gcmp::WeakReferenceable
    {
    public:
        SliderAppearanceSetting();
        ~SliderAppearanceSetting() {};

    public:
        inline int fontSize() const { return m_fontSize; }
        void setFontSize(int fs) { m_fontSize = fs; }

        inline int handleWidth() const { return m_handleWidth; }
        void setHandleWidth(int sh) { m_handleWidth = sh; }

        inline int handleMargin() const { return m_handleMargin; }
        void setHandleMargin(int sh) { m_handleMargin = sh; }

        inline int handleRadius() const { return m_handleRadius; }
        void setHandleRadius(int sh) { m_handleRadius = sh; }

        inline int handleBorder() const { return m_handleBorder; }
        void setHandleBorder(int sh) { m_handleBorder = sh; }

        inline int grooveHeight() const { return m_grooveHeight; }
        void setGrooveHeight(int gh) { m_grooveHeight = gh; }

        inline int grooveRadius() const { return m_grooveRadius; }
        void setGrooveRadius(int sh) { m_grooveRadius = sh; }

        inline int textBorder() const { return m_textBorder; }
        void setTextBorder(int tb) { m_textBorder = tb; }

        inline int textHeight() const { return m_textHeight; }
        void setTextHeight(int th) { m_textHeight = th; }

        inline int textWidth() const { return m_textWidth; }
        void setTextWidth(int th) { m_textWidth = th; }
        
        inline int textRadius() const { return m_textRadius; }
        void setTextRadius(int th) { m_textRadius = th; }

        inline int unitBorder() const{ return m_unitBorder; }
        void setUnitBorder(int ub) { m_unitBorder = ub; }

        inline int unitHeight() const { return m_unitHeight; }
        void setUnitHeight(int uh) { m_unitHeight = uh; }

        inline int unitWidth() const { return m_unitWidth; }
        void setUnitWidth(int th) { m_unitWidth = th; }

        inline const Color* handleClickedColor() const { return m_handleClickedColor.get(); }
        void setHandleClickedColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setHandleClickedColor(const Color& color) { m_handleClickedColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* handleNormalColor() const { return m_handleNormalColor.get(); }
        void setHandleNormalColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setHandleNormalColor(const Color& color) { m_handleNormalColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* handleBorderColor() const { return m_handleBorderColor.get(); }
        void setHandleBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setHandleBorderColor(const Color& color) { m_handleBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* handleHoveredColor() const { return m_handleHoveredColor.get(); }
        void setHandleHoveredColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setHandleHoveredColor(const Color& color) { m_handleHoveredColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* grooveColor() const { return m_grooveColor.get(); }
        void setGrooveColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setGrooveColor(const Color& color) { m_grooveColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textNormalColor() const { return m_textNormalColor.get(); }
        void setTextNormalColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextNormalColor(const Color& color) { m_textNormalColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textEdittingColor() const { return m_textEdittingColor.get(); }
        void setTextEdittingColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextEdittingColor(const Color& color) { m_textEdittingColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textNormalBorderColor() const { return m_textNormalBorderColor.get(); }
        void setTextNormalBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextNormalBorderColor(const Color& color) { m_textNormalBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textEdittingBorderColor() const { return m_textEdittingBorderColor.get(); }
        void setTextEdittingBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextEdittingBorderColor(const Color& color) { m_textEdittingBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textInvalidBorderColor() const { return m_textInvalidBorderColor.get(); }
        void setTextInvalidBorderColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextInvalidBorderColor(const Color& color) { m_textInvalidBorderColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* textColor() const { return m_textColor.get(); }
        void setTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setTextColor(const Color& color) { m_textColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* unitBackColor() const { return m_unitBackColor.get(); }
        void setUnitBackColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setUnitBackColor(const Color& color) { m_unitBackColor = NEW_AS_OWNER_PTR(Color, color); }

        inline const Color* unitTextColor() const { return m_unitTextColor.get(); }
        void setUnitTextColor(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
        void setUnitTextColor(const Color& color) { m_unitTextColor = NEW_AS_OWNER_PTR(Color, color); }

        void setCircleHandle(int radius, int border);
    private:
        int m_fontSize;

        // For slider
        int m_handleWidth;
        int m_handleMargin;
        int m_handleRadius;
        int m_handleBorder;
        int m_grooveHeight;
        int m_grooveRadius;
        gcmp::OwnerPtr<Color> m_handleClickedColor;
        gcmp::OwnerPtr<Color> m_handleHoveredColor;
        gcmp::OwnerPtr<Color> m_handleNormalColor;
        gcmp::OwnerPtr<Color> m_handleBorderColor;
        gcmp::OwnerPtr<Color> m_grooveColor;

        // for textEdit
        int m_textBorder;
        int m_textHeight;
        int m_textWidth;
        int m_textRadius;
        gcmp::OwnerPtr<Color> m_textNormalColor;
        gcmp::OwnerPtr<Color> m_textEdittingColor;
        gcmp::OwnerPtr<Color> m_textNormalBorderColor;
        gcmp::OwnerPtr<Color> m_textEdittingBorderColor;
        gcmp::OwnerPtr<Color> m_textInvalidBorderColor;
        gcmp::OwnerPtr<Color> m_textColor;

        // for unit text
        int m_unitBorder;
        int m_unitHeight;
        int m_unitWidth;
        gcmp::OwnerPtr<Color> m_unitBackColor;
        gcmp::OwnerPtr<Color> m_unitTextColor;

    };

    class GNUF_BASE_EXPORT MatrixButtonAppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(MatrixButtonAppearanceSetting)
    public:
        MatrixButtonAppearanceSetting();
        ~MatrixButtonAppearanceSetting() = default;

        // frame
        int spacing = 2;
        int margin = 1;

        // button
        int borderWidth = 1;
        int radius = 1;
        EIconSize iconSize = EIconSize::e12x12;

        Color normalBorderColor{};
        Color disableBorderColor{};
        Color selectedBorderColor{};
        Color hoverBorderColor{};

        Color normalColor{};
        Color disableColor{};
        Color selectedColor{};
        Color hoverColor{};
    };

    class GNUF_BASE_EXPORT AppearanceSetting final : public gcmp::WeakReferenceable
    {
        CANNOT_COPY_OR_ASSIGN(AppearanceSetting)
    public:
        enum class EStyle : std::uint8_t
        {
            eMainTitleBar = 0,
            eWindowTitleBar,
            eMainToolbar,
            eSmallMainToolbar,
            eViewTabBar,
            eBottomToolbar,
            eContextMenu,
            eAssistantPanel,
            eTree,
            eNameValuePairs,
            eFamilyTypes,
            eScrollbar,
            eHotKeyConfigurationPanel,
            ePreferenceSettingPanel,
            eCustom,
            eHotKeyInputBox,
            eTable,
            eApplicationVersionDialog,
            eSlider,
            eModuleBar,
            eSmallModuleBar
        };
    public:
        explicit AppearanceSetting(EStyle);
        ~AppearanceSetting();

    public:
        static int s_fontSize;
        static const int s_footerButtonMinimumWidth;
        static std::wstring s_fontFamily;
        static bool s_isInReplay;
        static void setFontFamilyId(int id);
        static void addFontFamilyId(int id);
        static void setGlobalFontSize(int val);
        static void setGlobalFontFamily(std::wstring fontFamily);
        static int globalFontSize() { return s_fontSize; }
        static std::wstring globalFontFamily() { return s_fontFamily; }
        inline void setTheme(ETheme val) { m_theme = val; }
        inline ETheme theme() const { return m_theme; }

        void setStyle(EStyle style) { setStyle(style, false); }
        inline EStyle style() const { return m_style; }

        inline void setFontSize(int val) { m_fontSize = val; }
        inline int fontSize() const { return m_fontSize; }

        inline void setShowCaption(bool val) { m_showCaption = val; }
        inline bool showCaption() const { return m_showCaption; }
        
        inline const ToolbarAppearanceSetting & toolbarAppearanceSetting() const {
            return m_toolbarAppearanceSetting;
        }
        inline ToolbarAppearanceSetting& toolbarAppearanceSetting(){
            return m_toolbarAppearanceSetting;
        }

        inline const ViewTabbarAppearanceSetting & viewtabbarAppearanceSetting() const {
            return m_viewtabbarAppearanceSetting;
        }   
   
        inline const WorkspaceTabBarApparanceSetting& workSpacetabBarAppearanceSetting() const {
            return m_workspacetabbarAppearanceSetting;
        }

        inline DropdownMenuAppearanceSetting* dropdownMenuAppearanceSetting()  {
            if (m_dropdownMenuAppearanceSetting == nullptr)
            {
                m_dropdownMenuAppearanceSetting = NEW_AS_OWNER_PTR(DropdownMenuAppearanceSetting);
            }
            return m_dropdownMenuAppearanceSetting.get();
        }
        inline const DropdownMenuAppearanceSetting* dropdownMenuAppearanceSetting() const {
            return m_dropdownMenuAppearanceSetting.get();
        }

        inline const NameValuePairsAppearanceSetting& nameValuePairsAppearanceSetting() const { return m_nameValuePairsApperanceSetting; }
        inline NameValuePairsAppearanceSetting& nameValuePairsAppearanceSetting() { return m_nameValuePairsApperanceSetting; }

        inline const NameValuePairsAppearanceSetting* tagNameOfNameValuePairAppearanceSetting() const { return m_tagNameOfNameValuePairsApperanceSetting.get(); }
        inline NameValuePairsAppearanceSetting* tagNameOfNameValuePairAppearanceSetting() {
            if (m_tagNameOfNameValuePairsApperanceSetting == nullptr)
            {
                m_tagNameOfNameValuePairsApperanceSetting = NEW_AS_OWNER_PTR(NameValuePairsAppearanceSetting);
            }
            return m_tagNameOfNameValuePairsApperanceSetting.get();
        }

        inline const ScrollbarAppearanceSetting* scrollbarAppearanceSetting() const {
            return m_scrollbarAppearanceSetting.get();
        }
        
        inline ScrollbarAppearanceSetting* scrollbarAppearanceSetting() {
            if (m_scrollbarAppearanceSetting == nullptr)
            {
                m_scrollbarAppearanceSetting = NEW_AS_OWNER_PTR(ScrollbarAppearanceSetting);
            }
            return m_scrollbarAppearanceSetting.get();
        }

        inline const SearchBoxAppearanceSetting* searchBoxAppearanceSetting() const {
            return m_searchBoxAppearanceSetting.get();
        }

        inline SearchBoxAppearanceSetting* searchBoxAppearanceSetting() {
            if (m_searchBoxAppearanceSetting == nullptr) {
                m_searchBoxAppearanceSetting = NEW_AS_OWNER_PTR(SearchBoxAppearanceSetting);
            }
            return m_searchBoxAppearanceSetting.get();
        }

        inline const TreeViewAppearanceSetting* treeViewAppearanceSetting() const {
            return m_treeViewAppearanceSetting.get();
        }

        inline TreeViewAppearanceSetting* treeViewAppearanceSetting() {
            if (m_treeViewAppearanceSetting == nullptr) {
                m_treeViewAppearanceSetting = NEW_AS_OWNER_PTR(TreeViewAppearanceSetting);
            }
            return m_treeViewAppearanceSetting.get();
        }

        inline const FamilyTypesAppearanceSetting* familyTypesAppearanceSetting() const {
            return m_familyTypesAppearanceSetting.get();
        }

        inline FamilyTypesAppearanceSetting* familyTypesAppearanceSetting() {
            if (m_familyTypesAppearanceSetting == nullptr) {
                m_familyTypesAppearanceSetting = NEW_AS_OWNER_PTR(FamilyTypesAppearanceSetting);
            }
            return m_familyTypesAppearanceSetting.get();
        }

        inline const ColorControlAppearanceSetting* colorControlAppearanceSetting() const {
            return m_colorControlAppearanceSetting.get();
        }

        inline ColorControlAppearanceSetting* colorControlAppearanceSetting() {
            if (m_colorControlAppearanceSetting == nullptr) {
                m_colorControlAppearanceSetting = NEW_AS_OWNER_PTR(ColorControlAppearanceSetting);
            }
            return m_colorControlAppearanceSetting.get();
        }

        inline TextAppearanceSetting * textAppearanceSetting() {
            if (m_textAppearanceSetting == nullptr)
            {
                m_textAppearanceSetting = NEW_AS_OWNER_PTR(TextAppearanceSetting);
            }
            return m_textAppearanceSetting.get();
        }

        inline const TextAppearanceSetting * textAppearanceSetting() const {
            return m_textAppearanceSetting.get();
        }

        inline LabelAppearanceSetting* labelAppearanceSetting() {
            if (nullptr == m_labelAppearanceSetting.get())
            {
                m_labelAppearanceSetting = NEW_AS_OWNER_PTR(LabelAppearanceSetting);
            }
            return m_labelAppearanceSetting.get();
        }
        inline const LabelAppearanceSetting* labelAppearanceSetting() const {
            return m_labelAppearanceSetting.get();
        }
        inline ListAppearanceSetting* listAppearanceSetting() {
            if (m_listAppearanceSetting == nullptr)
            {
                m_listAppearanceSetting = NEW_AS_OWNER_PTR(ListAppearanceSetting);
            }
            return m_listAppearanceSetting.get();
        }

        inline const ListAppearanceSetting* listAppearanceSetting() const {
            return m_listAppearanceSetting.get();
        }

        inline const ButtonAppearanceSetting* buttonAppearanceSetting() const {
            return m_buttonAppearanceSetting.get();
        }

        inline ButtonAppearanceSetting* buttonAppearanceSetting() {
            if (m_buttonAppearanceSetting == nullptr) {
                m_buttonAppearanceSetting = NEW_AS_OWNER_PTR(ButtonAppearanceSetting);
            }
            return m_buttonAppearanceSetting.get();
        }

        inline GridAppearanceSetting* gridAppearanceSetting() {
            if (m_gridAppearanceSetting == nullptr) {
                m_gridAppearanceSetting = NEW_AS_OWNER_PTR(GridAppearanceSetting);
            }
            return m_gridAppearanceSetting.get();
        }

        inline const GridAppearanceSetting* gridAppearanceSetting() const {
            return m_gridAppearanceSetting.get();
        }

        inline const ButtonAppearanceSetting* scrollButtonAppearanceSetting() const {
            return m_scrollButtonAppearanceSetting.get();
        }

        inline ButtonAppearanceSetting* scrollButtonAppearanceSetting() {
            if (m_scrollButtonAppearanceSetting == nullptr) {
                m_scrollButtonAppearanceSetting = NEW_AS_OWNER_PTR(ButtonAppearanceSetting);
            }
            return m_scrollButtonAppearanceSetting.get();
        }

        inline const DropDownBoardAppearanceSetting* dropDownBoardAppearanceSetting() const {
            return m_dropDownBoardAppearanceSetting.get();
        }

        inline DropDownBoardAppearanceSetting* dropDownBoardAppearanceSetting() {
            if (m_dropDownBoardAppearanceSetting == nullptr) {
                m_dropDownBoardAppearanceSetting = NEW_AS_OWNER_PTR(DropDownBoardAppearanceSetting);
            }
            return m_dropDownBoardAppearanceSetting.get();
        }

        inline const ProgressBarAppearanceSetting* progressBarAppearanceSetting() const {
            return m_progressbarAppearanceSetting.get();
        }

        inline ProgressBarAppearanceSetting* progressBarAppearanceSetting() {
            if (m_progressbarAppearanceSetting == nullptr) {
                m_progressbarAppearanceSetting = NEW_AS_OWNER_PTR(ProgressBarAppearanceSetting);
            }
            return m_progressbarAppearanceSetting.get();
        }

        inline const LineEditComboBoxAppearanceSetting* lineEditComboBoxSetting() const {
            return m_lineEditComboBoxSetting.get();
        }

        inline LineEditComboBoxAppearanceSetting* lineEditComboBoxSetting() {
            if (m_lineEditComboBoxSetting == nullptr) {
                m_lineEditComboBoxSetting = NEW_AS_OWNER_PTR(LineEditComboBoxAppearanceSetting);
            }
            return m_lineEditComboBoxSetting.get();
        }

        inline const TableAppearanceSetting * tableAppearanceSetting() const {
            return m_tableAppearanceSetting.get();
        }

        inline TableAppearanceSetting* tableAppearanceSetting() {
            return m_tableAppearanceSetting.get();
        }

        inline const SliderAppearanceSetting* sliderAppearanceSetting() const {
            return m_sliderAppearanceSetting.get();
        }

        inline SliderAppearanceSetting* sliderAppearanceSetting() {
            if (nullptr == m_sliderAppearanceSetting)
            {
                m_sliderAppearanceSetting = NEW_AS_OWNER_PTR(SliderAppearanceSetting);
            }
            return m_sliderAppearanceSetting.get();
        }
        inline const TagAppearanceSetting* tagAppearanceSetting() const {
            return m_tagAppearanceSetting.get();
        }

        inline TagAppearanceSetting* tagAppearanceSetting() {
            if (nullptr == m_tagAppearanceSetting)
            {
                m_tagAppearanceSetting = NEW_AS_OWNER_PTR(TagAppearanceSetting);
            }
            return m_tagAppearanceSetting.get();
        }        
        inline const TagPadAppearanceSetting* tagPadAppearanceSetting() const {
            return m_tagPadAppearanceSetting.get();
        }

        inline TagPadAppearanceSetting* tagPadAppearanceSetting() {
            if (nullptr == m_tagPadAppearanceSetting)
            {
                m_tagPadAppearanceSetting = NEW_AS_OWNER_PTR(TagPadAppearanceSetting);
            }
            return m_tagPadAppearanceSetting.get();
        }

        inline MatrixButtonAppearanceSetting* matrixButtonAppearanceSetting() {
            if (nullptr == m_matrixButtonAppearanceSetting)
            {
                m_matrixButtonAppearanceSetting = NEW_AS_OWNER_PTR(MatrixButtonAppearanceSetting);
            }
            return m_matrixButtonAppearanceSetting.get();
        }
        inline const MatrixButtonAppearanceSetting* matrixButtonAppearanceSetting() const {
            return m_matrixButtonAppearanceSetting.get();
        }

    private:
        static void setFontFamily();
        void setStyle(EStyle, bool initializing);

    private:
        ETheme m_theme;
        EStyle m_style;
        int m_fontSize;
        bool m_showCaption;
        ToolbarAppearanceSetting m_toolbarAppearanceSetting;
        ViewTabbarAppearanceSetting m_viewtabbarAppearanceSetting;
        WorkspaceTabBarApparanceSetting m_workspacetabbarAppearanceSetting;
        gcmp::OwnerPtr< DropdownMenuAppearanceSetting > m_dropdownMenuAppearanceSetting;
        NameValuePairsAppearanceSetting m_nameValuePairsApperanceSetting;
        gcmp::OwnerPtr<NameValuePairsAppearanceSetting> m_tagNameOfNameValuePairsApperanceSetting;
        gcmp::OwnerPtr<ScrollbarAppearanceSetting> m_scrollbarAppearanceSetting;

        gcmp::OwnerPtr<SearchBoxAppearanceSetting> m_searchBoxAppearanceSetting;
        gcmp::OwnerPtr<TreeViewAppearanceSetting> m_treeViewAppearanceSetting;
        gcmp::OwnerPtr<FamilyTypesAppearanceSetting> m_familyTypesAppearanceSetting;
        gcmp::OwnerPtr<ColorControlAppearanceSetting> m_colorControlAppearanceSetting;
        gcmp::OwnerPtr<TextAppearanceSetting> m_textAppearanceSetting;
        gcmp::OwnerPtr<LabelAppearanceSetting> m_labelAppearanceSetting;
        gcmp::OwnerPtr<ListAppearanceSetting> m_listAppearanceSetting;

        //////////////////////////////////////////////////////////////////////////////////////
        gcmp::OwnerPtr<GridAppearanceSetting> m_gridAppearanceSetting;
        gcmp::OwnerPtr<ButtonAppearanceSetting> m_buttonAppearanceSetting;
        gcmp::OwnerPtr<ButtonAppearanceSetting> m_scrollButtonAppearanceSetting;
        gcmp::OwnerPtr<DropDownBoardAppearanceSetting> m_dropDownBoardAppearanceSetting;
        gcmp::OwnerPtr<ProgressBarAppearanceSetting> m_progressbarAppearanceSetting;
        gcmp::OwnerPtr<LineEditComboBoxAppearanceSetting> m_lineEditComboBoxSetting;

        gcmp::OwnerPtr<TableAppearanceSetting> m_tableAppearanceSetting;
        gcmp::OwnerPtr<SliderAppearanceSetting> m_sliderAppearanceSetting;

        gcmp::OwnerPtr<TagAppearanceSetting> m_tagAppearanceSetting;
        gcmp::OwnerPtr<TagPadAppearanceSetting> m_tagPadAppearanceSetting;
        gcmp::OwnerPtr<MatrixButtonAppearanceSetting> m_matrixButtonAppearanceSetting;
    };
}
